			<?php 
				$siteid = $site['id'];
				$socialqry = dbSelect('sites_socialnetworks',array("site_id=$siteid")); 
				if(mysql_numrows($socialqry) > 0){
			?>
			
			<?php
					while($socialrow = mysql_fetch_array($socialqry)){
						$thesocialnetid = $socialrow['socialnet_id'];
						$socialnet = mysql_fetch_array(dbSelect('ddl_socialnetworks',array("id=$thesocialnetid")));
			?>	
						<!---repeatable social--->
							<div class="socialdiv" title="<?php echo $socialnet['name']; ?>: <?php echo $socialrow['username']; ?>">
								<a href="<?php echo $socialnet['urlbefore']; ?><?php echo $socialrow['username']; ?><?php echo $socialnet['urlafter']; ?>" target="_blank"><img src="<?php echo $o['images']; ?>/social/<?php echo $socialnet['icon']; ?>" /></a>
							</div>
						<!---repeatable social--->
					<?php } /* end while */ ?> 

				<?php } /* end if */ ?>